/*
 * File:   F19.h
 * Author: jcrada
 *
 * Created on 30 May 2011, 1:02 PM
 */

#ifndef ECB_CEC10_F19_H
#define	ECB_CEC10_F19_H

#include "ecb/benchmarks/cec10/CecProblem.h" 

#include "ecb/benchmarks/cec10/CecMath.h"
#include "ecb/operator/Shifted.h"
#include "ecb/function/Schwefel1_2.h"


namespace ecb{
    namespace cec10 {

        class F19 : public CecProblem {
        private:
            Function* schwefel;
        public:

            F19(int dimensions, int mValue)
            : CecProblem("F19", "Shifted Schwefel's Function", dimensions,
            -100, 100, true, mValue, new CecRandom(19l)) {

                std::vector<scalar> shift = CecMath::ShiftVector(dimensions, _properties->getMinimum(), _properties->getMaximum(), randomizer());
                schwefel = new Shifted(shift, 0, new Schwefel1_2());

            }

            ~F19() {
                delete schwefel;
            }

            scalar f(const std::vector<scalar>& x) {
                return schwefel->f(x);
            }
        };
    }
}


#endif	/* ECB_CEC10_F19_H */

